<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>后台管理</title>
    

    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="../css/font.css">
    <link rel="stylesheet" href="../css/xadmin.css">
    <script type="text/javascript" src="../js/jquery-3.2.1.js"></script>
    <script type="text/javascript" src="../lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="../js/xadmin.js"></script>
</head>

	<body>
		<div class="x-body">
			<form class="layui-form" lay-filter="formTest">
				<div class="layui-form-item">
					<label for="userName" class="layui-form-label">
                  账号
              </label>
					<div class="layui-input-inline">
						<input type="text" id="userName" name="userName" lay-verify="required" autocomplete="off" value="" class="layui-input" disabled="disabled">
					</div>
				</div>

				<div class="layui-form-item">
					<label for="presonName" class="layui-form-label">
                  姓名
              </label>
					<div class="layui-input-inline">
						<input type="text" id="presonName" name="presonName" lay-verify="required" autocomplete="off" value="" class="layui-input" disabled="disabled">
					</div>
				</div>

				<div class="layui-form-item">
					<label for="personAge" class="layui-form-label">
                  年龄
              </label>
					<div class="layui-input-inline">
						<input type="text" id="personAge" name="personAge" lay-verify="number" autocomplete="off" value="" class="layui-input" disabled="disabled">
					</div>
				</div>

				<div class="layui-form-item">
					<label class="layui-form-label">性别</label>
					<div class="layui-input-block">
						<input type="radio" name="personSex" value="男" title="男" autocomplete="off" disabled="disabled">
						<input type="radio" name="personSex" value="女" title="女" autocomplete="off" disabled="disabled">
					</div>
				</div>

				<div class="layui-form-item">
					<label for="telephone" class="layui-form-label">
                 	联系电话
              </label>
					<div class="layui-input-inline">
						<input type="text" id="telephone" name="telephone" lay-verify="phone" autocomplete="off" value="" class="layui-input" disabled="disabled">
					</div>
				</div>
			</form>
			<div class="layui-form-item">
                    <label for="L_repass" class="layui-form-label"></label>
                    <button id="edit" class="layui-btn"><i class="layui-icon">&#xe642;</i>编辑</button>
                </div>
				
		</div>
		<script>
		
			layui.use([ 'form', 'layer' ], function() {

				var form = layui.form, layer = layui.layer;

				$.ajax({
					type : "get",
					url : "getOwnInfo",
					async : true,
					cache : false,
					dataType : 'json',
					success : function(result) {
						console.log(result);
						form.val("formTest", result)
					},
					error : function() {
						layer.alert("与服务器连接异常", {icon: 2});
					}
				});
				
				$('#edit').on('click', function() {
                  layer.open({
                      type: 2,
                      area: ['600px', '500px'],
                      fix: false, //不固定
                      maxmin: true,
                      shadeClose: true,
                      shade:0.4,
                      title: "编辑",
                      content: 'userUpdate.html',
                      end:function(index){ 
                    	  location.reload()
                      }
                  });
                  return false;
              });
			});
		</script>

	</body>

</html>